package com.shop.zkmall.app.controller.a;

import com.shop.zkmall.app.domain.res.AttentionRes;
import com.shop.zkmall.app.service.a.ICereBuyerUserFollowService;
import com.shop.zkmall.app.utils.R;
import com.shop.zkmall.commons.domain.common.PageParam;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("bank")
@RequiredArgsConstructor
@Tag(name = "关注模块", description = "关注模块")
public class BuyerAttentionController {

    private final ICereBuyerUserFollowService cereBuyerUserFollowService;


    /**
     * 关注或取消关注 0关注 1取消关注
     */
    @RequestMapping("addOrCancel")
    public R<String> addOrCancel(Long targetId, Integer type) {
        return cereBuyerUserFollowService.addOrCancel(targetId, type);
    }


    /**
     * 获取关注列表
     */
    @RequestMapping("attentionList")
    public R<List<AttentionRes>> attentionList(PageParam param) {
        return cereBuyerUserFollowService.attentionList(param);
    }

    /**
     * 获取粉丝列表
     */
    @RequestMapping("fanList")
    public R<List<AttentionRes>> fanList(PageParam param) {
        return cereBuyerUserFollowService.fanList(param);
    }


}
